<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">
    <h:form id="frmViewCodeRegister">
        <f:view>
            <p:contextMenu for="dlgViewCodeRegister">
                <p:menuitem value="New"
                            icon="ui-icon-search"
                            oncomplete="wgCreateRegisterCode.show();"
                            update=":frmCreateRegisterCode:dlgCreateRegisterCode"
                            />              
                <p:menuitem value="Copy"
                            icon="ui-icon-search"
                            actionListener="#{employeeManagement.copyCode}"
                            />  
                <p:submenu label="Export" icon="ui-icon-extlink">
                    <p:submenu label="All Data">
                        <p:menuitem value="To Excel 2010"  ajax="false"  >
                            <p:dataExporter type="xls" target="dtViewCodeRegister"  fileName="Employee" />
                        </p:menuitem>
                        <p:menuitem value="To XML" ajax="false" >
                            <p:dataExporter type="xml" target="dtViewCodeRegister" fileName="Employee"/>
                        </p:menuitem>
                        <p:menuitem value="To PDF" ajax="false" >
                            <p:dataExporter type="pdf" target="dtViewCodeRegister" fileName="Employee"/>
                        </p:menuitem>
                    </p:submenu>
                    <p:submenu label="All Data in Page">
                        <p:menuitem value="To Excel 2010" ajax="false" >
                            <p:dataExporter type="xls" target="dtViewCodeRegister" fileName="Employee" pageOnly="true" />
                        </p:menuitem>
                        <p:menuitem value="To XML" ajax="false" >
                            <p:dataExporter type="xml" target="dtViewCodeRegister" fileName="Employee" pageOnly="true"/>
                        </p:menuitem>
                    </p:submenu>
                </p:submenu>
            </p:contextMenu>
            <p:focus context="dtViewCodeRegister"/>
            <p:dialog id="dlgViewCodeRegister"
                      widgetVar="wgViewCodeRegister"
                      header="View Code Register"
                      draggable="true"
                      showEffect="clip"
                      hideEffect="clip">



                <p:dataTable id="dtViewCodeRegister"
                             value="#{employeeManagement.listCode}"
                             rowKey="#{item.userId}"
                             selection="#{employeeManagement.selectUsers}"
                             selectionMode="single"
                             var="item"
                             filteredValue="#{employeeManagement.filteredListCode}"
                             paginator="true"
                             rows="5">

                    <p:column sortBy="#{item.codeRegister}"
                              filterBy="#{item.codeRegister}"
                              filterMatchMode="contains">
                        <f:facet name="header">
                            <h:outputText value="Code Register"/>
                        </f:facet>
                        <h:outputText value="#{item.codeRegister}"/>
                    </p:column>

                    <p:column sortBy="#{item.job.jobTitle}"
                              filterBy="#{item.job.jobTitle}"
                              filterMatchMode="contains" rendered="#{system.manager}">
                        <f:facet name="header">
                            <h:outputText value="JOB"/>
                        </f:facet>
                        <h:outputText value="#{item.job.jobTitle}"/>
                    </p:column>

                    <p:column sortBy="#{item.isLock}"
                              filterBy="#{item.isLock}"
                              filterMatchMode="contains">
                        <f:facet name="header">
                            <h:outputText value="Status"/>
                        </f:facet>
                        <h:outputText value="#{item.isLock}"/>
                    </p:column>
                </p:dataTable>


           

            </p:dialog>
        </f:view>
    </h:form>
</html>
